#include "Building.h"
#include "SceneFloder/BaseScene.h"
#include <QKeyEvent>
#include <QGraphicsSceneMouseEvent>
#include <QTimer>


Building::Building()
{
    this->m_timer=new QTimer(this);
    connect(this->m_timer,SIGNAL(timeout()),this, SLOT(mouseClick()));
}

Building::~Building()
{
    if(NULL!=this->m_timer)
    {
        delete this->m_timer;
        this->m_timer=NULL;
    }
    if(NULL!=this->m_connectScene)
    {
        delete this->m_connectScene;
        this->m_connectScene=NULL;
    }
}

BaseScene *Building::getParentScene() const
{
    return this->m_parentScene;
}

void Building::setParentScene(BaseScene *parentScene)
{
    this->m_parentScene=parentScene;
}

BaseScene *Building::getConnectScene() const
{
    return this->m_connectScene;
}

void Building::setConnectScene(BaseScene *connectScene)
{
    this->m_connectScene=connectScene;
}

BuildingType Building::getBuildingType() const
{
    return this->m_buildingType;
}

void Building::mouseClick()
{
}

void Building::selectReset()
{
    this->m_isSelect=false;
}

void Building::keyPressEvent(QKeyEvent *event)
{
    QGraphicsItem::keyPressEvent(event);
}

void Building::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
    QGraphicsItem::mousePressEvent(event);
}
